package com.bbx.taxi.client.Activity.login;

import com.bbx.androidapi.util.SharedPreUtil;
import com.bbx.api.util.SharedPreEncryptUtil;
import com.bbx.taxi.client.R;
import com.bbx.taxi.client.Bean.Value;
import com.bbx.taxi.client.Fragment.MyFragment;
import com.bbx.taxi.client.Util.ImageLoad.ImageLoader;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import butterknife.Bind;

/**
 * 作者：严旭文 on 2016/5/25 15:26
 */
public class WelcomeFragment extends MyFragment {
	@Bind(R.id.iv_launch)
	ImageView iv_launch;

	@Override
	public void onCreateView(Bundle savedInstanceState) {
		setContentView(R.layout.welcomefragment);
	}

	public void initView() {
		String launch_page = SharedPreUtil.getStringValue(getActivity(),
				SharedPreEncryptUtil.launch_page, "");
		onShow(launch_page);
	}

	public void onShow(String launch_page) {
		if (Value.isLocationXinJiang(getActivity())) {
			iv_launch.setBackgroundDrawable(getActivity().getResources()
					.getDrawable(R.drawable.xinjiang));
		}
		else if (Value.isLocationSichuan(getActivity())) {
			iv_launch.setBackgroundDrawable(getActivity().getResources()
					.getDrawable(R.drawable.sichuan));
		}
         //读取本地的广告业暂时取消
//		else if (launch_page != null && !launch_page.equals("")) {
//			ImageLoader imageLoader = new ImageLoader(getActivity());
//			try {
//				imageLoader.DisplayImage(launch_page, iv_launch, true);
//			} catch (Exception e) {
//			}
//		}
	}

}
